<template>
	<view>
		<!-- #ifdef MP-WEIXIN -->
		<myheader class="my-header" :leftType="2" :noLeft="false" :showTitle="store.storeName" :textLeft="textLeft"></myheader>
		<!-- #endif -->
		<view class="content">
			<view class="content-1 border">
				<image :src="store.storeLogo" class="content-1-img"></image>
				<view class="content-1-right">
					<view class="content-1-right-1">{{store.storeName}}</view>
					<view class="content-1-right-2">我是店铺特点</view>
					<view class="content-1-right-3">
						<image src="../../static/dui.svg" class="content-1-right-3-img"></image>
						<view class="content-1-right-3-txt">已认证</view>
					</view>
				</view>
			</view>
			<view class="content-2 border">
				<view class="content-2-1">联系方式</view>
				<view class="content-2-2 border">
					<image  class="content-2-2-img" src="../../static/shop1.svg" mode=""></image>
					<view class="content-2-2-txt">{{store.address}}</view>
					<image  class="content-2-2-img" src="../../static/shop4.svg" mode=""></image>
				</view>
				<view class="content-2-2">
					<image  class="content-2-2-img" src="../../static/shop3.svg" mode=""></image>
					<view class="content-2-2-txt">{{store.telephone}}</view>
					<image  class="content-2-2-img" src="../../static/shop2.svg" mode=""></image>
				</view>
			</view>
			<view class="content-3">
				<view class="content-3-1">从业资质</view>
				<view class="content-3-2 border" style="margin-left:20rpx" v-if="store.certifyPics.length==0">暂未提供</view>
				<view class="content-3-3 border">
					<view class="content-3-3-item" v-for="(item, index) in store.certifyPics" :key="index">
						<image  :src="item" class="content-3-3-item-img" mode=""></image>
					</view>
				</view>
				<view class="content-3-1">未上传介绍信息.</view>
			</view>
			<!-- <view class="content-3" style="margin-top: 10px;border-top-left-radius: 10px;
		border-top-right-radius: 10px;">
				<view class="content-3-1">商家相册</view>
				<view class="content-3-2 border" style="margin-left:20rpx" v-if="arr.length==0">暂未提供</view>
				 <view class="content-3-3">
					<view class="content-3-3-item" v-for="(item, index) in 10" :key="index">
						<image  src="" class="content-3-3-item-img" mode=""></image>
					</view>
				</view>
			</view> -->
		</view>
		<view class="tabbar-wrap">
			<block >
				<view @click="onFirst" class="tab-item">
					<image class="icon" :src="store.storeLogo"></image>
				</view>
			</block>
			<block v-for="(item, index) in list" :key="index">
				<view @click="onTab(item)" v-show="active !== index" class="tab-item">
					<image class="icon" :class="{ 'mid-button': item.midButton }" :src="item.iconPath"></image>
					<text  class="txt" :style="{ color: color }">{{ item.text }}</text>
				</view>
				<view @click="onTab(item)" v-show="active === index" class="tab-item">
					<image class="icon" :class="{ 'mid-button': item.midButton }" :src="item.selectedIconPath"></image>
					<text class="txt" :style="{ color: selectedColor }">{{ item.text }}</text>
				</view>
			</block>
		</view>
	</view>
</template>

<script>
import {
	mapGetters
} from "vuex";
	import myheader from '../../components/header/index.vue';
	export default {
		components: {
			myheader
		},
		computed: {
			...mapGetters(["store"]),
		},
		data() {
			return {
				textLeft: true,
				active: 2,
				params: {
					cursor: null,
					pageSize: 10
				},
				search: '',
				headerHight: 80,
				arr: [],
				list: [
					// {
					// 	"pagePath": "/pages/index/index",
					// 	"text": "吃巧",
					// 	"iconPath": "/static/tabBar/first.svg", // 默认图片
					// 	"selectedIconPath": "/static/tabBar/firstSelect.svg" // 选中图片
					// },
					{
						"pagePath": "/pages/shop/service",
						"text": "服务",
						"iconPath": "/static/tabBar/second.svg", // 默认图片
						"selectedIconPath": "/static/tabBar/secondSelect.svg" // 选中图片
					},
					{
						"pagePath": "/pages/shop/sub",
						"text": "已订",
						"iconPath": "/static/tabBar/third.svg", // 默认图片
						"selectedIconPath": "/static/tabBar/thirdSelect.svg" // 选中图片
					},
					{
						"pagePath": "/pages/shop/about",
						"text": "关于",
						"iconPath": "/static/tabBar/fourth.svg", // 默认图片
						"selectedIconPath": "/static/tabBar/fourthSelect.svg" // 选中图片
					}
				],
				
			}
		},
		onLoad() {
		},
		beforeMount() {
			let selectQuery = uni.createSelectorQuery().in(this);
			selectQuery.selectAll('.my-header').boundingClientRect(rect => {
				this.headerHight = rect[0].height;
			}).exec()
			this.$forceUpdate();
		},
		
		methods: {
			onFirst() {
				uni.reLaunch({
					url: '/pages/shop/shop?shopId=' + this.store.storeId
				})
			},
			onTab(item) {
				uni.navigateTo({
					url: item.pagePath
				})
			},
			
		}
	}
</script>

<style lang="scss" scoped>
.tabbar-wrap {
	    position: fixed;
	    bottom: 0;
	    width: 100%;
	    z-index: 90;
	    background-color: #fff;
	    padding: 20px 0px 20px 0px;
		padding-bottom: calc(constant(safe-area-inset-bottom));
		padding-bottom: calc(env(safe-area-inset-bottom));
	    display: flex;
	    align-items: center;
		border-top: 1px solid #f4f6f7;
		.tab-item {
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			flex: 1;
			height: 100%;
			border-radius: 8px;
			position: relative;
	
			.icon {
				width: 24px;
				height: 24px;
				border-radius: 50%;
			}
	
			.txt {
				margin-top: 3px;
				font-size: 12px;
			}
	
			.number {
				background-color: #FA3534;
				color: #fff;
				border-radius: 50%;
				position: absolute;
				right: 25rpx;
				top: 5px;
				display: inline-block;
				width: 20px;
				height: 20px;
				font-size: 10px;
				display: flex;
				justify-content: center;
				align-items: center;
			}
	
			.mid-button {
				width: 43px;
				height: 43px;
			}
		}
	
		.tab-item[hidden] {
			display: none !important;
		}
	}
	.border {
		border-bottom: 1px solid #efecea;
	}
.content {
	padding: 10px 10px 100px;
	width:calc(100% - 20px);
	&-3 {
		background: #fff;
		border-bottom-left-radius: 10px;
		border-bottom-right-radius: 10px;
		&-1 {
			font-size: 14px;
			font-weight: 400;
			color: rgba(130, 146, 162, 1);
			padding:10px;
		}
		&-2 {
			font-size: 16px;
			color: rgba(46, 73, 100, 1);
			font-weight: 400;
			padding-bottom:10px;
		}
		&-3 {
			display: flex;
			flex-wrap: wrap;
			padding: 0 10px;
			&-item {
				width: 25%;
				margin-bottom: 10px;
				display: flex;
				align-items: center;
				justify-content: center;
				&-img {
					width: 76px;
					height:76px;
					border-radius: 5px;
					background-color: rgba(203, 209, 216, 1);
				}
			}
		}
		
	}
	&-2 {
		background: #fff;
		&-1 {
			font-size: 14px;
			font-weight: 400;
			color: rgba(130, 146, 162, 1);
			padding:10px;
		}
		&-2 {
			display: flex;
			align-items: center;
			padding: 10px 0;
			margin: 0 10px;
			&-img {
				width:20px;
				height:20px
			}
			&-txt {
				font-size: 16px;
				font-weight: 400;
				color: rgba(46, 73, 100, 1);
				white-space: nowrap;
				text-overflow: ellipsis;
				overflow: hidden;
				flex:1;
				margin: 0 10px;
			}
		}
	}
	&-1 {
		display: flex;
		background: #fff;
		padding: 10px;
		border-top-left-radius: 10px;
		border-top-right-radius: 10px;
		&-img {
			width: 76px;
			height:76px;
			border-radius: 10px;
			background-color: rgba(234, 236, 239, 1);
			margin-right:10px
		}
		&-right {
			display: flex;
			flex-direction: column;
			justify-content: space-evenly;
			&-1 {
				color: rgba(46, 73, 100, 1);
				font-size: 20px;
				font-weight: 700;
			}
			&-2 {
				color: rgba(130, 146, 162, 1);
				font-weight: 400;
				font-size: 14px;
			}
			&-3 {
				display: flex;
				background-color: rgba(26, 188, 156, 1);
				align-items: center;
				padding: 2px 1px;
				justify-content: center;
				width:62px;
				border-radius: 999px;
				&-img {
					width: 16px;
					height: 16px;
					margin-right: 4px;
				}
				&-txt {
					font-size: 12px;
					font-weight: 700;
					color: #fff;
					
				}
			}
		}
	}
}
</style>
